package com.example.practical_training_projects.mapper;

import com.example.practical_training_projects.entity.askform;
import com.example.practical_training_projects.entity.questionform;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface askformMapper {
    @Select("select * from askform")
    List<askform> getAllAF();
    //增加
    @Insert("insert into askform (a_name,a_context,q_uid)\n" +
            " values (#{a_name},#{a_context},#{q_uid})")
    Integer insertAF(askform af);
    //删除
    @Delete("delete from askform where a_uid=#{a_uid}")
    Integer deleteAF(Integer af);
    //更新
    @Update("update askform set a_name=#{a_name},a_context=#{a_context} where a_uid = #{a_uid}")
    Integer updateAF(askform af);
    @Select("select * from  askform where a_uid = #{a_uid}")
    questionform findAFuid(Integer a_uid);

    @Select("select * from askform where q_uid = #{q_uid}")
    List<askform> getAskFormsByQUid(Integer q_uid);
}

